﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Primitives
{
    public struct SingleSegment
    {
        private SinglePoint m_p0;
        public SinglePoint P0
        {
            get { return m_p0; }
            set { m_p0 = value; }
        }

        private SinglePoint m_p1;
        public SinglePoint P1
        {
            get { return m_p1; }
            set { m_p1 = value; }
        }

        public SingleSegment(SinglePoint p0, SinglePoint p1)
        {
            m_p0 = p0;
            m_p1 = p1;
        }

        public float Length()
        {
            float dx = P1.X - P0.X;
            float dy = P1.Y - P0.Y;

            return (float)Math.Sqrt(dx * dx + dy * dy);
        }
    }
}
